package router

import (
	"cgs-server/server"
	"cgs-server/server/cgs/app/api"
	"cgs-server/server/cgs/app/store/mongo"
)

func initWorksheetRowsRouter() {
	storeIns, _ := mongo.GetMongoFactory()

	handler := api.NewWorksheetRowsHandler(storeIns)

	server.Get("/api/app/worksheet/rows/get", handler.Get, "", server.Login)
	server.Post("/api/app/worksheet/rows/delete", handler.Delete, "", server.Login)
	server.Post("/api/app/worksheet/rows/update", handler.Update, "", server.Login)
	server.Post("/api/app/worksheet/rows/save", handler.Save, "", server.Login)
	server.Post("/api/app/worksheet/rows/list", handler.List, "", server.Login)
	server.Post("/api/app/worksheet/rows/batch-save", handler.BatchSave, "", server.Login)
	server.Post("/api/app/worksheet/rows/batch-update", handler.BatchUpdate, "", server.Login)
	server.Post("/api/app/worksheet/rows/batch-delete", handler.BatchDelete, "", server.Login)

	server.Post("/api/app/worksheet/rows/savePublic", handler.SavePublic, "", server.None)
}
